<?php
/**
 * @author gao xiang from livesdrop.com
 * @copyright 2009
 * @uses 功能函数
 */
/*html头信息*/
function html_header()
{
	$head_echo = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>'.$database->arr_config_r[1].'</title>
	<meta name="description" content="'.$database->arr_config_r[3].'" />
	<link rel="alternate" type="application/rss+xml" title="'.$database->arr_config_r[2].'" href="'.$database->arr_config_r[4].'feed/" />
	<link rel="stylesheet" type="text/css" href="'.$database->arr_config_r[4].'style.css" media="all" />
 </head>
';
echo $head_echo;
}

function format_date($datetime){
	 	switch (strlen($datetime)){
 		case 4:
 			$date_result[0]=$datetime . "-01-01" ;
 			$date_result[1]=$datetime+1 . "-01-01" ;
 			break;
		case 6:
			$year = substr($datetime,0,4);
			$month = substr($datetime,4,2);
			$date_result[0]=$year . "-" . $month .  "-" . "01" ;
 			$date_result[1]=$year . "-" . ($month+1) .  "-" . "01" ;
			break;
		case 8:
			$year = substr($datetime,0,4);
			$month = substr($datetime,4,2);
			$day = substr($datetime,6,2);
			$date_result[0]=$year . "-" . $month .  "-" . $day ;
 			$date_result[1]=$year . "-" . $month .  "-" . ($day+1) ;
			break;
		default :
			echo "The server have encountered fatal error. Please mail to administer !";
}
return $date_result;
}
?>